package com.yitao.cms.task;


import com.skipper.base.utils.DateUtil;
import com.yitao.cms.service.order.CmsOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class UserGradeTask {

    private static final Logger LOGGER = LoggerFactory.getLogger(UserGradeTask.class);

    @Autowired
    private CmsOrderService cmsOrderService;


    @Scheduled(cron = "0 */6 * * * ?")
    public void addShopUserGrad() {
        Date date = new Date();
        LOGGER.info("Start Time 【{}】", DateUtil.formatAsDate(date));
        cmsOrderService.addShopUserGrad(date);
        LOGGER.info("END Time 【{}】", DateUtil.formatAsDate(date));
    }

}
